﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace K9Nano.Logging;

/// <summary>
/// 记录HTTP请求日志
/// </summary>
[Table("HttpLog")]
public class ApiLogEntity
{
    [Column(Order = 0)]
    public long Id { get; set; }

    [StringLength(255)]
    public string ControllerName { get; set; }

    [StringLength(255)]
    public string ActionName { get; set; }

    [StringLength(255)]
    public string? DisplayName { get; set; }

    [StringLength(10)]
    public string HttpMethod { get; set; }

    [StringLength(500)]
    public string Url { get; set; }

    public int StatusCode { get; set; }

    public long Duration { get; set; }

    public string? Arguments { get; set; }

    public string? Result { get; set; }

    [StringLength(50)]
    public long? UserId { get; set; }

    [StringLength(50)]
    public string? UserName { get; set; }

    [StringLength(50)]
    public string? ClientIp { get; set; }

    public string? UserAgent { get; set; }

    [Column(Order = 1000)]
    public DateTime CreatedAt { get; set; }
}
